package com.ruoyi.common.enums;

public enum YesOrNo {
    YES("y","yes"),
    NO("n","no");

    private String value;
    private String desc;

    YesOrNo(String value, String desc){
        this.value = value;
        this.desc = desc;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public  boolean eq(String value){
        return this.value.equals(value);
    }

    public static YesOrNo get(String val) {
        for (YesOrNo value : YesOrNo.values()) {
            if (value.getValue().equals(val)) {
                return value;
            }
        }
        return null;
    }
}
